package order

import (
	"context"
	"git.900sui.cn/kc/rpcinterface/client"
	"git.900sui.cn/kc/rpcinterface/interface/market"
	"git.900sui.cn/kc/rpcinterface/interface/order"
)

type Share struct {
	client.Baseclient
}

//初始化
func (s *Share) Init() *Share {
	s.ServiceName = "rpc_order"
	s.ServicePath = "Share"
	return s
}

//获取共享卡包信息-综合卡、身份卡
func (s *Share) GetCardPackageForShare(ctx context.Context, relationId int, reply *order.ReplyGetCardPackageForShare) error {
	return s.Call(ctx, "GetCardPackageForShare", relationId, reply)
}

//使用消费卡项同样逻辑去验证消费的有效性,冻结卡包面值返回冻结id
func (s *Share) ShareConsumeVerify(ctx context.Context, args market.ArgsShareConsume, reply *market.ReplyShareConsumeToOrder) error {
	return s.Call(ctx, "ShareConsumeVerify", args, reply)
}

//批量获取卡包信息
func (s *Share) GetCardPackageInfos(ctx context.Context, args order.ArgsGetCardPackageInfos, reply *order.ReplyGetCardPackageInfos) error {
	return s.Call(ctx, "GetCardPackageInfos", args, reply)
}

//确认消费
func (s *Share) ShareConsumeService(ctx context.Context, args *order.ArgsShareConsumeService, reply *bool) (err error) {
	return s.Call(ctx, "ShareConsumeService", args, reply)
}

//定期更新过期冻结面值
func (s *Share) UpdateOvertimeFrozen(ctx context.Context, args string, reply *bool) (err error) {
	return s.Call(ctx, "UpdateOvertimeFrozen", args, reply)
}

//共享卡包详情
func (s *Share) GetShareCardPackageInfo(ctx context.Context, args *order.ArgsShareCardPackageInfo, reply *order.ReplyShareCardCardPackageInfo) (err error) {
	return s.Call(ctx, "GetShareCardPackageInfo", args, reply)
}
